<ul class="content-box-tabs">

    <li><select name="zhangben" class="search form-control zhangben">
        <option value="-1">选择账本</option>
        <volist name="zhangben_array" id="class">
            <option value="{$class['id']}"
            <if condition="$class['id'] eq $_REQUEST['zhangben'] "> selected='selected'</if>
            >{$class['name']}</option>
        </volist>
    </select></li>
    <if condition="$Think.ACTION_NAME==chukuzhang">
    <li><select name="gid" class="search form-control zhangben">
        <option value="-1">选择商品</option>
        <volist name="goods_array" id="class">
            <option value="{$class['id']}"
            <if condition="$class['id'] eq $_REQUEST['gid'] "> selected='selected'</if>
            >{$class['name']}</option>
        </volist>
    </select></li>
    </if>

    <li><input class="search form-control input-group date datepicker" name="begin_date" value="{$_REQUEST['begin_date']}" data-provide="datepicker" placeholder="开始日期"/></li>
    <li><input class="search form-control input-group date datepicker" name="end_date" value="{$_REQUEST['end_date']}"  data-provide="datepicker"  placeholder="结束日期"/></li>    <li>
        <button class="search form-control form_enter" rel="orange" type="button"
                onclick="submitFun('cha');">查询
        </button>
        </td>
    </li>
</ul>
<script type="text/javascript">
    $(function(){
        $('.zhangben').live("change",(function(){

            var zhanben_id=$(this).children('option:selected').val();

            var url='/Admin/Kucun/ajax_zhangben/id/'+zhanben_id+'.html';
            $.ajax({
                type : 'POST',
                url : url,
                dataType : 'json',
                success : function(data) {
                    $('input[name="begin_date"]').val(data.begin_date);
                    $('input[name="end_date"]').val(data.end_date);
                }
            });

        }));
    })
</script>

